/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package auctions;

import java.util.ArrayList;

/**
 *
 * @author hangsu
 */
public abstract class ScheduleAuction {
    
    protected int auctionIdx;
    
    protected int bidderNum;
    
    protected double reservePrice;
    
    protected ArrayList<ScheduleAgent> agents;
    
    protected AuctionResult result;
    
    protected AuctionType type;
    
    protected boolean quiet;
        
    public abstract void runAuction();
    
    public abstract void initializeBidders();
    
    public ScheduleAuction(int auctionIdx, AuctionType type) {
        this.auctionIdx=auctionIdx;
        this.type=type;
        this.reservePrice=0.0; /*default: no reserve price*/
        this.quiet=false;
        this.result=new AuctionResult(auctionIdx);
    }
    
    public void setAgents(ArrayList<ScheduleAgent> agents) {
        this.agents=agents;
        this.bidderNum=agents.size();
    }
    
    public void setReservePrice(double reservePrice) {
        this.reservePrice=reservePrice;
    }
    
    public AuctionResult getAuctionResult() {
        return this.result;
    }
    
    public boolean isQuiet() {
        return this.quiet;
    }
    
    public void clear() {
        this.quiet=false;
        if(this.result!=null)
            this.result.clear();
    }
    
}
